package com.shopping_back.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shopping_back.common.Result;
import com.shopping_back.pojo.entity.MemberOrder;
import jakarta.servlet.http.HttpServletRequest;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface MemberService extends IService<MemberOrder> {

    Map<String, String> getMemberValidity(HttpServletRequest request);

    /**
     * 获取可升级选项（需高于当前等级）
     */
    List<Integer> getAvailableLevels(Long userId);

    /**
     * 升级会员（支付成功后调用）
     */
    Result upgradeMember(Long userId, Integer targetLevel, Integer months);

    /**
     * 续费会员（支付成功后调用）
     */
    Result renewMember(Long orderId, Integer months);

    boolean executeAutoDowngrade(Long userId);

    BigDecimal getMemberDiscount(Long userId);
}
